#{extends 'CRUD/layout.html' /}
#{set title:messages.get('clinicalmanifestationcomplaint.edit') /}

<div id="crudShow" class="${type.name}">

    <h2 id="crudShowTitle">&{'clinicalmanifestationcomplaint.edit'}</h2>

    <div class="objectForm">
    #{form action:@save(object._key()), enctype:'multipart/form-data'}
        #{crud.form fields:['clinicalManifestationComplainName', 'multyplier', 'syndrome', 'clinicalManifestations']}
        	#{crud.custom 'clinicalManifestations'}
	    		<label for="clinicalManifestations"><a href="@{ClinicalManifestations.list()}" class="nonUnderlined">&{'objects.clinicalmanifestations'}</a></label>
	    		%{clinicalManifestations = models.ClinicalManifestation.find("byClinicalManifestationComplaint", object).fetch()}%
	    		#{if clinicalManifestations != null && !clinicalManifestations.isEmpty()}
	    		<div class="list">
					#{list items:clinicalManifestations, as:'clinicalManifestation'}
			           	<li>
			           		<span id="${clinicalManifestation.id}" class="hiddenLinks">
								@{ClinicalManifestations.show(clinicalManifestation.id)}
			        		</span>
			        		${clinicalManifestation.name}
		        		</li>
				    #{/list}
				</div>
				#{/if}
	    		#{else}
					&{'crud.list.empty'}
				#{/else}
        	#{/crud.custom}
        #{/crud.form}
        <p class="crudButtons">
            <input type="submit" name="_save" value="&{'crud.save', type.modelName}" />
            <input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', type.modelName}" />
        </p>
    #{/form}
    </div>

    #{form @delete(object._key())}
        <p class="crudDelete">
            <input type="submit" value="&{'clinicalmanifestationcomplaint.delete'}" onclick="return confirm('&{'clinicalmanifestationcomplaint.delete'}')"/>
        </p>
    #{/form}

</div>